<template>
  <div class="statement-management">
    <div class="header">
      <h2 class="title">
        工行对账管理
      </h2>
      <tabs :tabs-arr="tabArr" @returnIndex="handleTab" />
      <el-form :inline="true" label-position="right">
        <el-form-item label="订单编号">
          <el-input v-model="searchParams.orderNo" class="input-width" type="text" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="收款方 ">
          <el-select
            v-model="searchParams.payeeName"
            class="input-width"
            filterable
            clearable
            remote
            placeholder="搜索选择项"
            :remote-method="e => getPayOptions(e, 'payeeName')"
            @change="clearOptions"
          >
            <el-option v-for="item in payeeNameOptions" :key="item" :label="item" :value="item" />
          </el-select>
        </el-form-item>
        <el-form-item label="付款方 ">
          <el-select
            v-model="searchParams.payerName"
            class="input-width"
            filterable
            clearable
            remote
            placeholder="搜索选择项"
            :remote-method="e => getPayOptions(e, 'payerName')"
            @change="clearOptions"
          >
            <el-option v-for="item in payerNameOptions" :key="item" :label="item" :value="item" />
          </el-select>
        </el-form-item>
        <el-form-item label="到账时间">
          <el-date-picker
            v-model="searchParams.toAccountDate"
            type="daterange"
            range-separator="至"
            value-format="yyyy-MM-dd"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            placeholder="请选择"
          />
        </el-form-item>
        <el-form-item label="支付时间">
          <el-date-picker
            v-model="searchParams.payDate"
            type="daterange"
            range-separator="至"
            value-format="yyyy-MM-dd"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            placeholder="请选择"
          />
        </el-form-item>
        <el-form-item class="form-button">
          <el-button type="primary" @click="search">
            查询
          </el-button>
          <el-button @click="reset">
            重置
          </el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class="hr" />
    <section class="el-container container-box is-vertical">
      <div class="operate">
        <el-button type="primary" :disabled="excelBtnDisabled" @click="exportEx">
          导出
        </el-button>
      </div>
      <el-editable
        v-loading="tableLoading"
        :data="payload.content"
        height="200"
        :columns="columns"
        :payload="payload"
        :need-pagination="true"
        @reload="reloadTableData"
      >
        <template slot="default-action" slot-scope="scope">
          <el-button type="text" @click="checkDetail(scope.row)">
            查看
          </el-button>
        </template>
      </el-editable>
    </section>
  </div>
</template>

<script src="./index.js"></script>

<style lang="less" src="./index.less" scoped></style>
